package com.jprocms.module.cms.controller.admin.content.vo;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.jpro.framework.common.pojo.PageParam;
import com.jprocms.module.cms.query.WhereCondition;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.lang.Nullable;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;

import static com.jpro.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 内容分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ContentPageReqVO extends PageParam {

    @Schema(description = "站点ID")
    private Long siteId;

    @Schema(description = "父栏目ID")
    private Long channelId;

    @Schema(description = "是否查询引用栏目")
    private Boolean querySubChannel = false;

    @Schema(description = "栏目ID")
    private Collection<Long> channelIds;

    @Schema(description = "内容状态(1:已发布;   2:流转中;   3:待发布;  4:退回;  5:下线  6:草稿;   7 删除 ")
    private Integer status;

    @Schema(description = "内容标题")
    private String title;

    @Schema(description = "发布时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private Date[] releaseTime;

    //service组装给xml使用，前端用 releaseTime 传递
    @Schema(description = "发布时间查询开始时间")
    private Date releaseTimeStart;

    @Schema(description = "发布时间查询结束时间")
    private Date releaseTimeEnd;

    @Schema(description = "置顶级别")
    private Integer topLevel;

    @Schema(description = "原文ID")
    private Long originContentId;

    @Schema(description = "创建方式（1:直接创建    2:投稿  3:手动引用  4:主动采集   5:复制  ")
    private Short createMode;

    @Schema(description = "部门id,后端构建")
    private Set<Long> deptIds;

    @Schema(description = "创建人ID")
    private Long userId;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private Date[] createTime;
    //service组装给xml使用，前端用 createTime 传递
    private Date createTimeBegin;
    private Date createTimeEnd;

    /**
     * 标记属性
     */
    @Schema(description = "标记属性")
    private Long dictMark;
    /**
     * 区块ID
     */
    @Schema(description = "区块")
    private Long dictBlock;

    //前端传递用的排序
    private Collection<String> orderStrs;
    //后端组装构建排序
    private Collection<OrderItem> orderItems;
    //后端组装连接查询的表
    private Collection<JoinTable> joinTables;

    //前端查询用，后端查询暂时无用
    @Nullable
    private List<WhereCondition> customsConditions;

    /*********(后台暂时没用上具体业务用途，为了共用sql方便)******************/
    /**
     * tagId
     */
    @Schema(description = "tagId")
    private Collection<Long> tagIds;
    /**
     * 标记属性
     */
    @Schema(description = "标记属性")
    private Collection<Long> dictMarks;
    /**
     * 区块ID
     */
    @Schema(description = "区块")
    private Collection<Long> dictBlocks;

    @Schema(description = "排除内容id")
    private Collection<Long> excludeIds;

    @Schema(description = "排除标记属性")
    private Collection<Long> excludeDictMarks;
    /**
     * 区块ID
     */
    @Schema(description = "排除区块")
    private Collection<Long> excludeDictBlocks;

    @Schema(description = "是否预览内容")
    private Integer livePreview;

}
